package com.example.smartcity_poverty.ui.AllService.GovernmentHotLine.Activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import com.example.smartcity_poverty.App.Companion.getToken
import com.example.smartcity_poverty.App.Companion.url
import com.example.smartcity_poverty.R
import com.example.smartcity_poverty.logic.Repository.api
import com.example.smartcity_poverty.logic.model.GovernmentHotLine.GmHotLineUserListAllModel
import com.example.smartcity_poverty.logic.util.Util.glide
import com.example.smartcity_poverty.logic.util.Util.show
import kotlinx.android.synthetic.main.activity_show_gm_hot_line_user_all.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 * 诉求详情页
 */
class ShowGmHotLineUserAllActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
        setContentView(R.layout.activity_show_gm_hot_line_user_all)
        title = "诉求详情"

        // 诉求标题
        intent.getStringExtra("title")?.let { AgmMeTitle.text = it }
        // 诉求照片
        intent.getStringExtra("image")?.let { glide(url + it, AGmMeImage) }
        // 诉求承办单位
        intent.getStringExtra("undertaker")?.let { AgmMeUser.text = "承办单位: $it" }
        // 诉求诉 求 处 理 状 态
        intent.getStringExtra("state")?.let {
            if (it == "1") AgmMeIsOk.text = "处理状态: 处理中..."
            else AgmMeIsOk.text = "处理状态: 已处理"
        }
        // 诉求时间
        intent.getStringExtra("createTime")?.let { AgmMeTime.text = "发布时间: $it" }
        // 诉求处理结果
        intent.getStringExtra("detailResult")?.let { AgmMeOk.text = "处理结果: $it" }
        // 诉求内容
        intent.getStringExtra("content")?.let { AgmMeContent.text = "诉求内容: $it" }


    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        finish()
        return super.onOptionsItemSelected(item)
    }
}